<?= get_toolbar(array('accion' => 'custom')); ?>
<div class="row">
    <div class="col-md-12">
        <div class="portlet box green">
            <div class="portlet-title">
                <div class="caption"><i class="icon-cogs"></i>Usuarios</div>
            </div>
            <div class="portlet-body flip-scroll">
                <table class="table table-bordered table-condensed flip-content">
                    <thead class="flip-content">
                        <tr>
                            <th>Nick</th>
                            <th>Email</th>
                            <th>Ultimo login</th>
                            <th>Estado</th>
                            <th>Acciones</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($infousers as $user) { ?>
                            <tr>
                                <td><?= $user['usu_nick'] ?></td>
                                <td><?= $user['usu_email'] ?></td>
                                <td><?= $user['usu_ultimo_login'] ?></td>
                                <td class="col-md-1">
                                    <?php
                                    if ($user['usu_estado'] == 'P')
                                        echo '<span class="label label-sm label-warning">Pendiente</span>';
                                    if ($user['usu_estado'] == 'X')
                                        echo '<span class="label label-sm label-danger">Bloqueado</span>';
                                    if ($user['usu_estado'] == 'A')
                                        echo '<span class="label label-sm label-success">Activo</span>';
                                    ?>
                                </td>
                                <td class="col-md-2">
                                    <a class="btn btn-xs blue" href="<?= site_url(get_uri_string() . "/editar/" . $user['usu_id']); ?>" data-target="#ajax-modal" data-toggle="modal">
                                        <i class="icon-pencil"></i>
                                        Editar
                                    </a>
                                    <a class="btn btn-xs red" href="<?= site_url(get_uri_string()."/borrar/" . $user['usu_id'])?>" onclick="return confirm('<?=lang('mensaje_confirm_borrar')?>')">
                                        <i class="icon-remove"></i>
                                        Borrar
                                    </a>
                                </td>
                            </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="ajax-modal" tabindex="-1" role="basic" aria-hidden="true">
    <img src="<?= site_url(IMGBACK . "ajax-modal-loading.gif") ?>" alt="" class="loading">
</div>
<div id="basic" class="modal fade" aria-hidden="true" role="basic" tabindex="-1" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button class="close" aria-hidden="true" data-dismiss="modal" type="button"></button>
                <h4 class="modal-title">Modal Title</h4>
            </div>
            <div class="modal-body"> Modal body goes here </div>
            <div class="modal-footer">
                <button class="btn default" data-dismiss="modal" type="button">Close</button>
                <button class="btn blue" type="button">Save changes</button>
            </div>
        </div>
    </div>
</div>